<template>
	<view class="flex-column">
		<template v-if="list.length">
			<uni-card v-for="item in list" :key="item.id" :border="false" @click="goBatteryTestingReport(item)">
				<view class="flex-row-between">
					<test class="text-em">{{ item.plateNo }}</test>
					<test style="color: #1487fa; font-size: 30rpx">￥{{ (item.checkBalance / 100).toFixed(2) }}</test>
				</view>
				<view class="text-light-gray">充电订单编号：{{ item.checkOrderNo }}</view>
				<view class="text-light-gray" style="margin-top: 20rpx">生成时间：{{ item.createTime }}</view>
			</uni-card>
		</template>

		<Upgrading v-else />
	</view>
</template>

<script>
import { getBatteryReportList } from '@/api/batteryCheck';
import Upgrading from '@/components/upgrading/upgrading.vue';
export default {
	components: { Upgrading },
	data() {
		return {
			list: []
		};
	},
	created() {
		this.getBatteryReportList();
	},
	methods: {
		getBatteryReportList() {
			getBatteryReportList().then((res) => {
				this.list = res.data;
			});
		},
		goBatteryTestingReport(item) {
			uni.navigateTo({
				url: `/mine/pages/batteryTestingReport/batteryTestingReport?checkOrderNo=${item.checkOrderNo}&billNo=${item.billNo}`
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.text-light-gray {
	margin-top: 30rpx;
	color: #606266;
	font-size: 26rpx;
}
.text-em {
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 30rpx;
	color: #303133;
	line-height: 30rpx;
}
.flex-row-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.flex-column {
	display: flex;
	flex-direction: column;
	column-gap: 16rpx;
}
</style>
